package observerNotification;

import java.net.InetAddress;

import controller.Controller;
import controller.Controller.EnumEndTransfer;


/**
 * Message: finished tranfering a file in said conversation
 * 
 * <p>
 * <ul>
 * <li>Project: 	ChatSystemG3</li>
 * </ul>
 * </p>
 * 
 * @author COMBES Nicolas - LECHANTRE Arnaud
 * @see ObserverNotification
 */
public class FileTransferFinishedObserverNotification extends ConversationObserverNotification{

	private EnumEndTransfer endReason;

	public FileTransferFinishedObserverNotification(int convId,
			InetAddress ipAddress, String localUsername, EnumEndTransfer received) {
		super(convId, ipAddress, localUsername);
		this.endReason=received;
	}
	
	public String getNotification(){
		String s;
		if (endReason==Controller.EnumEndTransfer.SENT){
			s= "File transfer finished";
		} else if (endReason==Controller.EnumEndTransfer.ABORT){
			s= "File transfer abort";
		} else {// (endReason==Controller.EnumEndTransfer.RECEIVED)
			s= "File transfer received";
		}
		return s;
	}

	

}
